package com.example.demo.test;

import com.example.demo.entity.GeneralPublicBudgetRevenue;
import com.example.demo.entity.MinEconomicIndicators;
import com.example.demo.entity.QuarterlyGrossRegionalProduct;
import com.example.demo.entity.SectorProduct;
import com.example.demo.service.EconomicIndicatorsService;
import com.example.demo.service.IndustrialIndicatorsService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class testController {

    @Autowired
    private EconomicIndicatorsService economicIndicatorsService;

    @Autowired
    private IndustrialIndicatorsService industrialIndicatorsService;

    @Test
    public void testGetQuarterlyGrossRegionalProduct() {
        List<QuarterlyGrossRegionalProduct> list = economicIndicatorsService.getQuarterlyGrossRegionalProduct(2022);
        for(QuarterlyGrossRegionalProduct str : list) {
            System.out.println(str);
        }
        System.out.println(list);
    }

    @Test
    public void testGetAccumulatedQuarterlyGrossRegionalProduct() {
        List<QuarterlyGrossRegionalProduct> list = economicIndicatorsService.getAccumulatedQuarterlyGrossRegionalProduct(2022);
        for(QuarterlyGrossRegionalProduct str : list) {
            System.out.println(str);
        }
        System.out.println(list);
    }

    @Test
    public void testGeneralPublicBudgetRevenue() {
        List<GeneralPublicBudgetRevenue> list = economicIndicatorsService.getGeneralPublicBudgetRevenue(2022);
        for(GeneralPublicBudgetRevenue str : list) {
            System.out.println(str);
        }
        System.out.println(list);
    }

    @Test
    public void testEconomicIndicatorsByIndicators() {
        List<MinEconomicIndicators> list = economicIndicatorsService.getEconomicIndicatorsByIndicators(2022,"地区生产总值");
        for(MinEconomicIndicators str : list) {
            System.out.println(str);
        }
        System.out.println(list);
    }

    @Test
    public void testSectorProduct() {
        List<SectorProduct> list = industrialIndicatorsService.getSectorProduct(2022, 11);
        for(SectorProduct str : list) {
            System.out.println(str);
        }
        System.out.println(list);
    }

}
